import Mock from 'mockjs'
import './user.js'

// 模拟对 '/api/tabs' 的请求
Mock.mock('/api/tabs', 'get', function() {
  return Mock.mock({
    code: 200,
    data: {
      'list|20': [
        {
          'id|+1': 1,
          name: '@ctitle(3, 6)',
          image: '@image(64x64, @color)',
        },
      ],
    },
  })
})

// 模拟对 '/api/tab/1' 的请求
Mock.mock('/api/tab/1', 'get', function() {
  return Mock.mock({
    code: 200,
    data: {
      'banners|4': [
        {
          'id|+1': 12341,
          image: '@image(375x150, @color)',
        },
      ],
      items: {
        isEnd: false,
        total: 87,
        'list|20': [
          {
            couponValue: '',
            'id|+3': 110207079,
            image: '@image(48x64, @color)',
            isFreePostage: true,
            'originPrice|9-99': 25,
            'price|1-10': 6,
            'saleNum|5000-999999': 1,
            title: '@ctitle',
          },
        ],
      },
    },
  })
})
